package com.yq.cp.mapper.permission;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yq.cp.entity.permission.Permission;
import com.yq.cp.entity.permission.dto.PermissionDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zh
 * @since 2022-09-21
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    /** 查询所有的权限 */
    List<PermissionDto> queryAll(@Param("pId") Long pId,@Param("type") Integer type);
    /** 根据角色查询已分配的所有的权限 */
    List<PermissionDto> queryAllByRoleId(@Param("pId") Long pId,@Param("roleId") Long roleId,@Param("type")Integer type);
    /** 查询所有的权限,与分配情况 */
    List<PermissionDto> queryAllAndAllot(@Param("pId") Long pId, @Param("roleId") Long roleId,@Param("type")Integer type);

    List<Permission> selList(@Param("userId")Long userId);
}
